// Wall.cpp: implementation of the Wall class.
//
//////////////////////////////////////////////////////////////////////
#include "Block.h"
#include "Wall.h"
#include "stdlib.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Wall::Wall(int originX,int originY,int width,int height,int type)
{
 	int k=0;
/*	Block *block=(Block *)operator new((width+height)*2-4);*/
	Block *block=(Block *)malloc(((width+height)*2-4)*sizeof(Block));

	/*	
	//	what if i do:

		Block *block=(Block *)malloc(sizeof(Block));

	//	fucking strange!
	//	why can i even access block[409].
	//	would not it suppose to be only block[0]?
	*/
	for(int i=0;i<width;i++)
	{
		for(int j=0;j<height;j++)
		{
			if(i==0||j==0||i==width-1||j==height-1)
			{
				block[k]=Block(i,j,FULL,WALL);
				k++;
			}
		}
	}
}


Wall::~Wall()
{

}

